/* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

SSL Certificate Manager
SSL数字证书信息管理接口

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/

#import <Foundation/Foundation.h>
#import <JDCloudOCSDKSsl/SslApiModel.h>


@implementation SslUpdateCertNameResult
-(id) initWithCode:(NSNumber*) code
        message:(NSString*)message { 
    self.code = code;               
    self.message = message;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self code])
    {
        [result setValue:[self code] forKey:@"code"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.code = [dictionary objectForKey:@"code"];
    self.message = [dictionary objectForKey:@"message"];
    return self;
} 

@end
@implementation SslDescribeCertRequest
-(id) initWithRegion:(NSString *)regionId
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
certId:(NSString*)certId { 
    self.regionId = regionId;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.certId = certId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
certId:(NSString*)certId { 
    self.regionId = regionId;
    self.version = version;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.certId = certId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self certId])
    {
        [result setValue:[self certId] forKey:@"certId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    self.certId = [dictionary objectForKey:@"certId"];
    return self;
} 

@end
@implementation SslDownloadCertRequest
-(id) initWithRegion:(NSString *)regionId
serverType:(NSString*)serverType
certId:(NSString*)certId { 
    self.regionId = regionId;
    self.serverType = serverType;
    self.certId = certId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
serverType:(NSString*)serverType
certId:(NSString*)certId { 
    self.regionId = regionId;
    self.version = version;
    self.serverType = serverType;
    self.certId = certId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self serverType])
    {
        [result setValue:[self serverType] forKey:@"serverType"];
    }
    if([self certId])
    {
        [result setValue:[self certId] forKey:@"certId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.serverType = [dictionary objectForKey:@"serverType"];
    self.certId = [dictionary objectForKey:@"certId"];
    return self;
} 

@end
@implementation SslUpdateCertResult
-(id) initWithCertId:(NSString*) certId
        digest:(NSString*)digest { 
    self.certId = certId;               
    self.digest = digest;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self certId])
    {
        [result setValue:[self certId] forKey:@"certId"];
    }
    if([self digest])
    {
        [result setValue:[self digest] forKey:@"digest"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.certId = [dictionary objectForKey:@"certId"];
    self.digest = [dictionary objectForKey:@"digest"];
    return self;
} 

@end
@implementation SslDeleteCertsResult
-(id) initWithCode:(NSNumber*) code
        message:(NSString*)message { 
    self.code = code;               
    self.message = message;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self code])
    {
        [result setValue:[self code] forKey:@"code"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.code = [dictionary objectForKey:@"code"];
    self.message = [dictionary objectForKey:@"message"];
    return self;
} 

@end
@implementation SslUploadCertResult
-(id) initWithCertId:(NSString*) certId
        digest:(NSString*)digest { 
    self.certId = certId;               
    self.digest = digest;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self certId])
    {
        [result setValue:[self certId] forKey:@"certId"];
    }
    if([self digest])
    {
        [result setValue:[self digest] forKey:@"digest"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.certId = [dictionary objectForKey:@"certId"];
    self.digest = [dictionary objectForKey:@"digest"];
    return self;
} 

@end
@implementation SslUpdateCertRequest
-(id) initWithRegion:(NSString *)regionId
certId:(NSString*)certId
keyFile:(NSString*)keyFile
certFile:(NSString*)certFile { 
    self.regionId = regionId;
    self.certId = certId;
    self.keyFile = keyFile;
    self.certFile = certFile;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
certId:(NSString*)certId
keyFile:(NSString*)keyFile
certFile:(NSString*)certFile { 
    self.regionId = regionId;
    self.version = version;
    self.certId = certId;
    self.keyFile = keyFile;
    self.certFile = certFile;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self certId])
    {
        [result setValue:[self certId] forKey:@"certId"];
    }
    if([self keyFile])
    {
        [result setValue:[self keyFile] forKey:@"keyFile"];
    }
    if([self certFile])
    {
        [result setValue:[self certFile] forKey:@"certFile"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.certId = [dictionary objectForKey:@"certId"];
    self.keyFile = [dictionary objectForKey:@"keyFile"];
    self.certFile = [dictionary objectForKey:@"certFile"];
    return self;
} 

@end
@implementation SslUpdateCertNameRequest
-(id) initWithRegion:(NSString *)regionId
certId:(NSString*)certId
certName:(NSString*)certName { 
    self.regionId = regionId;
    self.certId = certId;
    self.certName = certName;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
certId:(NSString*)certId
certName:(NSString*)certName { 
    self.regionId = regionId;
    self.version = version;
    self.certId = certId;
    self.certName = certName;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self certId])
    {
        [result setValue:[self certId] forKey:@"certId"];
    }
    if([self certName])
    {
        [result setValue:[self certName] forKey:@"certName"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.certId = [dictionary objectForKey:@"certId"];
    self.certName = [dictionary objectForKey:@"certName"];
    return self;
} 

@end
@implementation SslUploadCertRequest
-(id) initWithRegion:(NSString *)regionId
certName:(NSString*)certName
keyFile:(NSString*)keyFile
certFile:(NSString*)certFile
aliasName:(NSString*)aliasName { 
    self.regionId = regionId;
    self.certName = certName;
    self.keyFile = keyFile;
    self.certFile = certFile;
    self.aliasName = aliasName;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
certName:(NSString*)certName
keyFile:(NSString*)keyFile
certFile:(NSString*)certFile
aliasName:(NSString*)aliasName { 
    self.regionId = regionId;
    self.version = version;
    self.certName = certName;
    self.keyFile = keyFile;
    self.certFile = certFile;
    self.aliasName = aliasName;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self certName])
    {
        [result setValue:[self certName] forKey:@"certName"];
    }
    if([self keyFile])
    {
        [result setValue:[self keyFile] forKey:@"keyFile"];
    }
    if([self certFile])
    {
        [result setValue:[self certFile] forKey:@"certFile"];
    }
    if([self aliasName])
    {
        [result setValue:[self aliasName] forKey:@"aliasName"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.certName = [dictionary objectForKey:@"certName"];
    self.keyFile = [dictionary objectForKey:@"keyFile"];
    self.certFile = [dictionary objectForKey:@"certFile"];
    self.aliasName = [dictionary objectForKey:@"aliasName"];
    return self;
} 

@end
@implementation SslDescribeCertsRequest
-(id) initWithRegion:(NSString *)regionId
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
domainName:(NSString*)domainName
certIds:(NSString*)certIds { 
    self.regionId = regionId;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.domainName = domainName;
    self.certIds = certIds;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
domainName:(NSString*)domainName
certIds:(NSString*)certIds { 
    self.regionId = regionId;
    self.version = version;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.domainName = domainName;
    self.certIds = certIds;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self domainName])
    {
        [result setValue:[self domainName] forKey:@"domainName"];
    }
    if([self certIds])
    {
        [result setValue:[self certIds] forKey:@"certIds"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    self.domainName = [dictionary objectForKey:@"domainName"];
    self.certIds = [dictionary objectForKey:@"certIds"];
    return self;
} 

@end
@implementation SslDeleteCertsRequest
-(id) initWithRegion:(NSString *)regionId
certId:(NSString*)certId { 
    self.regionId = regionId;
    self.certId = certId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
certId:(NSString*)certId { 
    self.regionId = regionId;
    self.version = version;
    self.certId = certId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self certId])
    {
        [result setValue:[self certId] forKey:@"certId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.certId = [dictionary objectForKey:@"certId"];
    return self;
} 

@end
@implementation SslDescribeCertResult
-(id) initWithCertId:(NSString*) certId
        certName:(NSString*)certName
        commonName:(NSString*)commonName
        certType:(NSString*)certType
        issuer:(NSString*)issuer
        startTime:(NSString*)startTime
        endTime:(NSString*)endTime
        dnsNames:(NSArray<NSString*>*)dnsNames
        digest:(NSString*)digest
        totalCount:(NSNumber*)totalCount
        usedBy:(NSArray<CertBindInfo*>*)usedBy { 
    self.certId = certId;               
    self.certName = certName;               
    self.commonName = commonName;               
    self.certType = certType;               
    self.issuer = issuer;               
    self.startTime = startTime;               
    self.endTime = endTime;               
    self.dnsNames = dnsNames;               
    self.digest = digest;               
    self.totalCount = totalCount;               
    self.usedBy = usedBy;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self certId])
    {
        [result setValue:[self certId] forKey:@"certId"];
    }
    if([self certName])
    {
        [result setValue:[self certName] forKey:@"certName"];
    }
    if([self commonName])
    {
        [result setValue:[self commonName] forKey:@"commonName"];
    }
    if([self certType])
    {
        [result setValue:[self certType] forKey:@"certType"];
    }
    if([self issuer])
    {
        [result setValue:[self issuer] forKey:@"issuer"];
    }
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    if([self dnsNames])
    {
        [result setValue:[self dnsNames] forKey:@"dnsNames"];
    }
    if([self digest])
    {
        [result setValue:[self digest] forKey:@"digest"];
    }
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    if([self usedBy])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self usedBy] count]; i++) {
            CertBindInfo* item = [[self usedBy] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"usedBy"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.certId = [dictionary objectForKey:@"certId"];
    self.certName = [dictionary objectForKey:@"certName"];
    self.commonName = [dictionary objectForKey:@"commonName"];
    self.certType = [dictionary objectForKey:@"certType"];
    self.issuer = [dictionary objectForKey:@"issuer"];
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    self.dnsNames = [dictionary objectForKey:@"dnsNames"];
    self.digest = [dictionary objectForKey:@"digest"];
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    NSArray* usedByArray = [dictionary objectForKey:@"usedBy"];
    if(usedByArray&&![usedByArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [usedByArray count];i++)
        {
        CertBindInfo* item = [[CertBindInfo alloc]initWithDic:[usedByArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.usedBy = propertyArray;
    }
    return self;
} 

@end
  
@implementation SslDescribeCertResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
SslDescribeCertResult* result = [[SslDescribeCertResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(SslDescribeCertResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation SslUploadCertResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
SslUploadCertResult* result = [[SslUploadCertResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(SslUploadCertResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation SslDownloadCertResult
-(id) initWithCertDesc:(NSArray<DownloadCertDesc*>*) certDesc { 
    self.certDesc = certDesc;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self certDesc])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self certDesc] count]; i++) {
            DownloadCertDesc* item = [[self certDesc] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"certDesc"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* certDescArray = [dictionary objectForKey:@"certDesc"];
    if(certDescArray&&![certDescArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [certDescArray count];i++)
        {
        DownloadCertDesc* item = [[DownloadCertDesc alloc]initWithDic:[certDescArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.certDesc = propertyArray;
    }
    return self;
} 

@end
  
@implementation SslDownloadCertResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
SslDownloadCertResult* result = [[SslDownloadCertResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(SslDownloadCertResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation SslDeleteCertsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
SslDeleteCertsResult* result = [[SslDeleteCertsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(SslDeleteCertsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation SslUpdateCertNameResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
SslUpdateCertNameResult* result = [[SslUpdateCertNameResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(SslUpdateCertNameResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation SslUpdateCertResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
SslUpdateCertResult* result = [[SslUpdateCertResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(SslUpdateCertResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation SslDescribeCertsResult
-(id) initWithCertListDetails:(NSArray<CertListDetail*>*) certListDetails
        totalCount:(NSNumber*)totalCount { 
    self.certListDetails = certListDetails;               
    self.totalCount = totalCount;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self certListDetails])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self certListDetails] count]; i++) {
            CertListDetail* item = [[self certListDetails] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"certListDetails"];
    }
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* certListDetailsArray = [dictionary objectForKey:@"certListDetails"];
    if(certListDetailsArray&&![certListDetailsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [certListDetailsArray count];i++)
        {
        CertListDetail* item = [[CertListDetail alloc]initWithDic:[certListDetailsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.certListDetails = propertyArray;
    }
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    return self;
} 

@end
  
@implementation SslDescribeCertsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
SslDescribeCertsResult* result = [[SslDescribeCertsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(SslDescribeCertsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
 
